

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
    <style>
    /* base */
    html,
    body,
    .container {
      width: 100%;
      height: 100%;
    }

    a,
    a:link,
    a:visited {
      text-decoration: none;
      color: inherit;
    }

    ul {
      list-style: none;
    }

    *,
    ::before,
    ::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    *:focus {
      outline: 0;
    }

    .container {
      display: flex;
      padding-top: 20px;
    }

    /* Nav */
    .container .doc-nav {
      position: fixed;
      height: 100%;
      margin: 0 30px 0 40px;
      width: 280px;
    }

    .doc-nav .nav-header {
      display: flex;
      align-items: center;
      box-sizing: border-box;
      background-color: rgb(240, 241, 242);
      height: 40px;
      padding: 16px;
      font-size: 18px;
      font-weight: 500;
      color: rgb(62, 64, 66);
      cursor: pointer;
    }

    .doc-nav .nav-content {
      height: calc(100% - 40px);
      overflow-y: auto;
      color: rgb(32, 34, 36);
    }

    .doc-nav .nav-content .nav-list,
    .doc-nav .nav-content .nav-sub-list {
      line-height: 1.5rem;
    }

    .doc-nav .nav-content .nav-label {
      display: inline-block;
      position: relative;
      padding: 2px 0 2px 20px;
      margin-bottom: 4px;
    }

    .doc-nav .nav-content .nav-sub-label {
      position: relative;
      padding: 2px 0 2px 40px;
      font-size: 14px;
    }

    .doc-nav .nav-content .nav-sub-label:hover {
      text-decoration: underline;
    }

    .doc-nav .nav-content .nav-list .nav-label.group::before {
      border-bottom: 0.25rem solid transparent;
      border-left: 0.25rem solid #6e7072;
      border-right: 0;
      border-top: 0.25rem solid transparent;
      content: '';
      display: block;
      height: 0;
      left: 0.5rem;
      position: absolute;
      top: 0.625rem;
      transition: transform 0.1s linear;
      width: 0;
    }

    .doc-nav .nav-content .nav-list .nav-label.group.active::before {
      transform: rotate(90deg);
    }

    /* doc content */
    .container .doc-content {
      position: fixed;
      height: 100%;
      width: calc(100% - 80px - 40px - 30px - 240px);
      right: 0%;
      overflow-y: auto;
    }

    .doc-title {
      border-bottom: 1px solid #dcdee0;
      font-size: 22px;
      margin: 8px 0 0;
      padding-bottom: 16px;
    }

    .doc-content h3 {
      font-size: 24px;
      font-weight: 600;
      margin: 24px 0;
    }

    .doc-content h4 {
      font-size: 22px;
      font-weight: 500;
      margin: 30px 0 8px;
    }

    .doc-content h4 span {
      color: #007d9c;
    }

    .doc-content .doc-declare {
      background-color: #fafafa;
      border-radius: 5px;
      border: 1px solid #ccc;
      font-size: 14px;
      overflow-x: auto;
      padding: 10px;
      tab-size: 4;
      line-height: 20px;
    }

    .doc-content .doc-comment {
      font-size: 16px;
      margin: 16px 0;
      line-height: 24px;
      word-break: break-word;
    }
  </style>

</head>
<body>
  <div class="container">
    <div class="doc-nav">
      <a href="#Documentation" class="nav-header">Documentation</a>
      <nav class="nav-content">
        <ul class="nav-list">
          <li>
            <a href="#includes" class="nav-label">Includes</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#bits.h" class="nav-sub-label">bits.h</a>
              </li>
      

              <li>
                <a href="#pdu.h" class="nav-sub-label">pdu.h</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#macros" class="nav-label">Macros</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#COAP_OPTION_H_" class="nav-sub-label">COAP_OPTION_H_</a>
              </li>
      

              <li>
                <a href="#COAP_OPT_FILTER_SHORT" class="nav-sub-label">COAP_OPT_FILTER_SHORT</a>
              </li>
      

              <li>
                <a href="#COAP_OPT_FILTER_LONG" class="nav-sub-label">COAP_OPT_FILTER_LONG</a>
              </li>
      

              <li>
                <a href="#COAP_OPT_FILTER_SIZE" class="nav-sub-label">COAP_OPT_FILTER_SIZE</a>
              </li>
      

              <li>
                <a href="#COAP_OPT_ALL" class="nav-sub-label">COAP_OPT_ALL</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#functions" class="nav-label">Functions</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#coap_opt_parse" class="nav-sub-label">coap_opt_parse</a>
              </li>
      

              <li>
                <a href="#coap_opt_size" class="nav-sub-label">coap_opt_size</a>
              </li>
      

              <li>
                <a href="#coap_option_filter_set" class="nav-sub-label">coap_option_filter_set</a>
              </li>
      

              <li>
                <a href="#coap_option_filter_unset" class="nav-sub-label">coap_option_filter_unset</a>
              </li>
      

              <li>
                <a href="#coap_option_filter_get" class="nav-sub-label">coap_option_filter_get</a>
              </li>
      

              <li>
                <a href="#coap_opt_setheader" class="nav-sub-label">coap_opt_setheader</a>
              </li>
      

              <li>
                <a href="#coap_opt_encode_size" class="nav-sub-label">coap_opt_encode_size</a>
              </li>
      

              <li>
                <a href="#coap_opt_encode" class="nav-sub-label">coap_opt_encode</a>
              </li>
      

              <li>
                <a href="#coap_add_optlist_pdu" class="nav-sub-label">coap_add_optlist_pdu</a>
              </li>
      

              <li>
                <a href="#coap_insert_optlist" class="nav-sub-label">coap_insert_optlist</a>
              </li>
      

              <li>
                <a href="#coap_delete_optlist" class="nav-sub-label">coap_delete_optlist</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#vars" class="nav-label">Vars</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#coap_opt_iterator_t" class="nav-sub-label">coap_opt_iterator_t</a>
              </li>
      

              <li>
                <a href="#coap_opt_t" class="nav-sub-label">coap_opt_t</a>
              </li>
      

              <li>
                <a href="#coap_opt_t" class="nav-sub-label">coap_opt_t</a>
              </li>
      

              <li>
                <a href="#uint16_t" class="nav-sub-label">uint16_t</a>
              </li>
      

              <li>
                <a href="#uint16_t" class="nav-sub-label">uint16_t</a>
              </li>
      

              <li>
                <a href="#coap_optlist_t" class="nav-sub-label">coap_optlist_t</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#consts" class="nav-label">Consts</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="# " class="nav-sub-label"> </a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#types" class="nav-label">Types</a>
            
            <ul class="nav-sub-list">
            
            </ul>
            
          </li>
          <li>
            <a href="#typedefs" class="nav-label">Typedefs</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#uint8_t" class="nav-sub-label">uint8_t</a>
              </li>
      

              <li>
                <a href="#coap_option_t;
" class="nav-sub-label">coap_option_t;
</a>
              </li>
      

              <li>
                <a href="#coap_opt_filter_t[COAP_OPT_FILTER_SIZE]" class="nav-sub-label">coap_opt_filter_t[COAP_OPT_FILTER_SIZE]</a>
              </li>
      

              <li>
                <a href="#coap_opt_iterator_t;
" class="nav-sub-label">coap_opt_iterator_t;
</a>
              </li>
      

              <li>
                <a href="#coap_optlist_t;
" class="nav-sub-label">coap_optlist_t;
</a>
              </li>
      
            </ul>
            
          </li>
        </ul>
      </nav>
    </div>
    <div class="doc-content">
      <h2 id="Documentation" class="doc-title">Documentation</h2>
      <h3 id="includes">Includes</h3>
      

      <h4 id="bits.h"><span>bits.h</span></h4>
      <pre class="doc-declare"><code>#include "bits.h"
</code></pre>
      <pre class="doc-comment">#include "bits.h"
</pre>

      <h4 id="pdu.h"><span>pdu.h</span></h4>
      <pre class="doc-declare"><code>#include "pdu.h"
</code></pre>
      <pre class="doc-comment">#include "pdu.h"
</pre>
      <h3 id="macros">Macros</h3>
      

      <h4 id="COAP_OPTION_H_">Marco <span>COAP_OPTION_H_</span></h4>
      <pre class="doc-declare"><code>#define COAP_OPTION_H_
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="COAP_OPT_FILTER_SHORT">Marco <span>COAP_OPT_FILTER_SHORT</span></h4>
      <pre class="doc-declare"><code>#define COAP_OPT_FILTER_SHORT 6
</code></pre>
      <pre class="doc-comment">/**
 * The number of option types below 256 that can be stored in an
 * option filter. COAP_OPT_FILTER_SHORT + COAP_OPT_FILTER_LONG must be
 * at most 16. Each coap_option_filter_t object reserves
 * ((COAP_OPT_FILTER_SHORT + 1) / 2) * 2 bytes for short options.
 */</pre>

      <h4 id="COAP_OPT_FILTER_LONG">Marco <span>COAP_OPT_FILTER_LONG</span></h4>
      <pre class="doc-declare"><code>#define COAP_OPT_FILTER_LONG 2
</code></pre>
      <pre class="doc-comment">/**
 * The number of option types above 255 that can be stored in an
 * option filter. COAP_OPT_FILTER_SHORT + COAP_OPT_FILTER_LONG must be
 * at most 16. Each coap_option_filter_t object reserves
 * COAP_OPT_FILTER_LONG * 2 bytes for short options.
 */</pre>

      <h4 id="COAP_OPT_FILTER_SIZE">Marco <span>COAP_OPT_FILTER_SIZE</span></h4>
      <pre class="doc-declare"><code>#define COAP_OPT_FILTER_SIZE                                       \
 (((COAP_OPT_FILTER_SHORT + 1) >> 1) + COAP_OPT_FILTER_LONG) +1
</code></pre>
      <pre class="doc-comment">/** The number of elements in coap_opt_filter_t. */</pre>

      <h4 id="COAP_OPT_ALL">Marco <span>COAP_OPT_ALL</span></h4>
      <pre class="doc-declare"><code>#define COAP_OPT_ALL NULL
</code></pre>
      <pre class="doc-comment">/** Pre-defined filter that includes all options. */</pre>
      <h3 id="functions">Functions</h3>
      

      <h4 id="coap_opt_parse">Func <span>coap_opt_parse</span></h4>
      <pre class="doc-declare"><code>size_t coap_opt_parse(const coap_opt_t *opt,
                     size_t length,
                     coap_option_t *result);</code></pre>
      <pre class="doc-comment">/**
 * Parses the option pointed to by @p opt into @p result. This function returns
 * the number of bytes that have been parsed, or @c 0 on error. An error is
 * signaled when illegal delta or length values are encountered or when option
 * parsing would result in reading past the option (i.e. beyond opt + length).
 *
 * @param opt    The beginning of the option to parse.
 * @param length The maximum length of @p opt.
 * @param result A pointer to the coap_option_t structure that is filled with
 *               actual values iff coap_opt_parse() > 0.
 * @return       The number of bytes parsed or @c 0 on error.
 */</pre>

      <h4 id="coap_opt_size">Func <span>coap_opt_size</span></h4>
      <pre class="doc-declare"><code>size_t coap_opt_size(const coap_opt_t *opt);</code></pre>
      <pre class="doc-comment">/**
 * Returns the size of the given option, taking into account a possible option
 * jump.
 *
 * @param opt An option jump or the beginning of the option.
 * @return    The number of bytes between @p opt and the end of the option
 *            starting at @p opt. In case of an error, this function returns
 *            @c 0 as options need at least one byte storage space.
 */</pre>

      <h4 id="coap_option_filter_set">Func <span>coap_option_filter_set</span></h4>
      <pre class="doc-declare"><code>int coap_option_filter_set(coap_opt_filter_t filter, uint16_t type);</code></pre>
      <pre class="doc-comment">/**
 * Sets the corresponding entry for @p type in @p filter. This
 * function returns @c 1 if bit was set or @c 0 on error (i.e. when
 * the given type does not fit in the filter).
 *
 * @param filter The filter object to change.
 * @param type   The type for which the bit should be set.
 *
 * @return       @c 1 if bit was set, @c 0 otherwise.
 */</pre>

      <h4 id="coap_option_filter_unset">Func <span>coap_option_filter_unset</span></h4>
      <pre class="doc-declare"><code>int coap_option_filter_unset(coap_opt_filter_t filter, uint16_t type);</code></pre>
      <pre class="doc-comment">/**
 * Clears the corresponding entry for @p type in @p filter. This
 * function returns @c 1 if bit was set or @c 0 on error (i.e. when
 * the given type does not fit in the filter).
 *
 * @param filter The filter object to change.
 * @param type   The type that should be cleared from the filter.
 *
 * @return       @c 1 if bit was set, @c 0 otherwise.
 */</pre>

      <h4 id="coap_option_filter_get">Func <span>coap_option_filter_get</span></h4>
      <pre class="doc-declare"><code>int coap_option_filter_get(coap_opt_filter_t filter, uint16_t type);</code></pre>
      <pre class="doc-comment">/**
 * Checks if @p type is contained in @p filter. This function returns
 * @c 1 if found, @c 0 if not, or @c -1 on error (i.e. when the given
 * type does not fit in the filter).
 *
 * @param filter The filter object to search.
 * @param type   The type to search for.
 *
 * @return       @c 1 if @p type was found, @c 0 otherwise, or @c -1 on error.
 */</pre>

      <h4 id="coap_opt_setheader">Func <span>coap_opt_setheader</span></h4>
      <pre class="doc-declare"><code>size_t coap_opt_setheader(coap_opt_t *opt,
                         size_t maxlen,
                         uint16_t delta,
                         size_t length);</code></pre>
      <pre class="doc-comment">/**
 * Encodes the given delta and length values into @p opt. This function returns
 * the number of bytes that were required to encode @p delta and @p length or @c
 * 0 on error. Note that the result indicates by how many bytes @p opt must be
 * advanced to encode the option value.
 *
 * @param opt    The option buffer space where @p delta and @p length are
 *               written.
 * @param maxlen The maximum length of @p opt.
 * @param delta  The actual delta value to encode.
 * @param length The actual length value to encode.
 *
 * @return       The number of bytes used or @c 0 on error.
 */</pre>

      <h4 id="coap_opt_encode_size">Func <span>coap_opt_encode_size</span></h4>
      <pre class="doc-declare"><code>size_t coap_opt_encode_size(uint16_t delta, size_t length);</code></pre>
      <pre class="doc-comment">/**
 * Compute storage bytes needed for an option with given @p delta and
 * @p length
 *
 * @param delta  The option delta.
 * @param length The option length.
 *
 * @return       The number of bytes required to encode this option.
 */</pre>

      <h4 id="coap_opt_encode">Func <span>coap_opt_encode</span></h4>
      <pre class="doc-declare"><code>size_t coap_opt_encode(coap_opt_t *opt,
                      size_t n,
                      uint16_t delta,
                      const uint8_t *val,
                      size_t length);</code></pre>
      <pre class="doc-comment">/**
 * Encodes option with given @p delta into @p opt. This function returns the
 * number of bytes written to @p opt or @c 0 on error. This happens especially
 * when @p opt does not provide sufficient space to store the option value,
 * delta, and option jumps when required.
 *
 * @param opt    The option buffer space where @p val is written.
 * @param n      Maximum length of @p opt.
 * @param delta  The option delta.
 * @param val    The option value to copy into @p opt.
 * @param length The actual length of @p val.
 *
 * @return       The number of bytes that have been written to @p opt or @c 0 on
 *               error. The return value will always be less than @p n.
 */</pre>

      <h4 id="coap_add_optlist_pdu">Func <span>coap_add_optlist_pdu</span></h4>
      <pre class="doc-declare"><code>int coap_add_optlist_pdu(coap_pdu_t *pdu, coap_optlist_t** optlist_chain);</code></pre>
      <pre class="doc-comment">/**
 * The current optlist of @p optlist_chain is first sorted (as per RFC7272
 * ordering requirements) and then added to the @p pdu.
 *
 * @param pdu  The pdu to add the options to from the chain list
 * @param optlist_chain The chained list of optlist to add to the pdu
 *
 * @return     @c 1 if succesful or @c 0 if failure;
 */</pre>

      <h4 id="coap_insert_optlist">Func <span>coap_insert_optlist</span></h4>
      <pre class="doc-declare"><code>int coap_insert_optlist(coap_optlist_t **optlist_chain,
                       coap_optlist_t *optlist);</code></pre>
      <pre class="doc-comment">/**
 * Adds @p optlist to the given @p optlist_chain. The optlist_chain variable
 * be set to NULL before the initial call to coap_insert_optlist().
 * The optlist_chain will need to be deleted using coap_delete_optlist()
 * when no longer required.
 *
 * @param optlist_chain The chain to add optlist to
 * @param optlist  The optlist to add to the queue
 *
 * @return         @c 1 if successful, @c 0 otherwise.
 */</pre>

      <h4 id="coap_delete_optlist">Func <span>coap_delete_optlist</span></h4>
      <pre class="doc-declare"><code>void coap_delete_optlist(coap_optlist_t *optlist_chain);</code></pre>
      <pre class="doc-comment">/**
 * Removes all entries from the @p optlist_chain, freeing off their
 * memory usage.
 *
 * @param optlist_chain The optlist chain to remove all the entries from
 */</pre>
      <h3 id="vars">Vars</h3>
      

      <h4 id="coap_opt_iterator_t">Variable <span>coap_opt_iterator_t</span></h4>
      <pre class="doc-declare"><code>coap_opt_iterator_t *coap_option_iterator_init(const coap_pdu_t *pdu,
                                              coap_opt_iterator_t *oi,
                                              const coap_opt_filter_t filter);</code></pre>
      <pre class="doc-comment">/**
 * Initializes the given option iterator @p oi to point to the beginning of the
 * @p pdu's option list. This function returns @p oi on success, @c NULL
 * otherwise (i.e. when no options exist). Note that a length check on the
 * option list must be performed before coap_option_iterator_init() is called.
 *
 * @param pdu    The PDU the options of which should be walked through.
 * @param oi     An iterator object that will be initilized.
 * @param filter An optional option type filter.
 *               With @p type != @c COAP_OPT_ALL, coap_option_next()
 *               will return only options matching this bitmask.
 *               Fence-post options @c 14, @c 28, @c 42, ... are always
 *               skipped.
 *
 * @return       The iterator object @p oi on success, @c NULL otherwise.
 */</pre>

      <h4 id="coap_opt_t">Variable <span>coap_opt_t</span></h4>
      <pre class="doc-declare"><code>coap_opt_t *coap_option_next(coap_opt_iterator_t *oi);</code></pre>
      <pre class="doc-comment">/**
 * Updates the iterator @p oi to point to the next option. This function returns
 * a pointer to that option or @c NULL if no more options exist. The contents of
 * @p oi will be updated. In particular, @c oi->n specifies the current option's
 * ordinal number (counted from @c 1), @c oi->type is the option's type code,
 * and @c oi->option points to the beginning of the current option itself. When
 * advanced past the last option, @c oi->option will be @c NULL.
 *
 * Note that options are skipped whose corresponding bits in the filter
 * specified with coap_option_iterator_init() are @c 0. Options with type codes
 * that do not fit in this filter hence will always be returned.
 *
 * @param oi The option iterator to update.
 *
 * @return   The next option or @c NULL if no more options exist.
 */</pre>

      <h4 id="coap_opt_t">Variable <span>coap_opt_t</span></h4>
      <pre class="doc-declare"><code>coap_opt_t *coap_check_option(coap_pdu_t *pdu,
                             uint16_t type,
                             coap_opt_iterator_t *oi);</code></pre>
      <pre class="doc-comment">/**
 * Retrieves the first option of type @p type from @p pdu. @p oi must point to a
 * coap_opt_iterator_t object that will be initialized by this function to
 * filter only options with code @p type. This function returns the first option
 * with this type, or @c NULL if not found.
 *
 * @param pdu  The PDU to parse for options.
 * @param type The option type code to search for.
 * @param oi   An iterator object to use.
 *
 * @return     A pointer to the first option of type @p type, or @c NULL if
 *             not found.
 */</pre>

      <h4 id="uint16_t">Variable <span>uint16_t</span></h4>
      <pre class="doc-declare"><code>uint16_t coap_opt_delta(const coap_opt_t *opt);</code></pre>
      <pre class="doc-comment">/**
 * Decodes the delta value of the next option. This function returns the number
 * of bytes read or @c 0 on error. The caller of this function must ensure that
 * it does not read over the boundaries of @p opt (e.g. by calling
 * coap_opt_check_delta().
 *
 * @param opt The option to examine.
 *
 * @return    The number of bytes read or @c 0 on error.
 */</pre>

      <h4 id="uint16_t">Variable <span>uint16_t</span></h4>
      <pre class="doc-declare"><code>uint16_t coap_opt_length(const coap_opt_t *opt);</code></pre>
      <pre class="doc-comment">/**
 * Returns the length of the given option. @p opt must point to an option jump
 * or the beginning of the option. This function returns @c 0 when @p opt is not
 * an option or the actual length of @p opt (which can be @c 0 as well).
 *
 * @note {The rationale for using @c 0 in case of an error is that in most
 * contexts, the result of this function is used to skip the next
 * coap_opt_length() bytes.}
 *
 * @param opt  The option whose length should be returned.
 *
 * @return     The option's length or @c 0 when undefined.
 */</pre>

      <h4 id="coap_optlist_t">Variable <span>coap_optlist_t</span></h4>
      <pre class="doc-declare"><code>coap_optlist_t *coap_new_optlist(uint16_t number,
                                size_t length,
                                const uint8_t *data);</code></pre>
      <pre class="doc-comment">/**
 * Create a new optlist entry.
 *
 * @param number    The option number (COAP_OPTION_*)
 * @param length    The option length
 * @param data      The option value data
 *
 * @return          A pointer to the new optlist entry, or @c NULL if error
 */</pre>
      <h3 id="consts">Consts</h3>
      

      <h4 id=" ">Const <span> </span></h4>
      <pre class="doc-declare"><code>const uint8_t *coap_opt_value(const coap_opt_t *opt);</code></pre>
      <pre class="doc-comment">/**
 * Returns a pointer to the value of the given option. @p opt must point to an
 * option jump or the beginning of the option. This function returns @c NULL if
 * @p opt is not a valid option.
 *
 * @param opt The option whose value should be returned.
 *
 * @return    A pointer to the option value or @c NULL on error.
 */</pre>
      <h3 id="types">Types</h3>
      
      <h3 id="typedefs">Typedefs</h3>
      

      <h4 id="uint8_t">Typedef <span>uint8_t</span></h4>
      <pre class="doc-declare"><code>typedef uint8_t coap_opt_t;
#define PCHAR(p) ((coap_opt_t *)(p))

</code></pre>
      <pre class="doc-comment">/**
 * Use byte-oriented access methods here because sliding a complex struct
 * coap_opt_t over the data buffer may cause bus error on certain platforms.
 */</pre>

      <h4 id="coap_option_t;
">Typedef <span>coap_option_t;
</span></h4>
      <pre class="doc-declare"><code>typedef struct {
 uint16_t delta;
 size_t length;
 const uint8_t *value;
} coap_option_t;
</code></pre>
      <pre class="doc-comment">/**
 * Representation of CoAP options.
 */</pre>

      <h4 id="coap_opt_filter_t[COAP_OPT_FILTER_SIZE]">Typedef <span>coap_opt_filter_t[COAP_OPT_FILTER_SIZE]</span></h4>
      <pre class="doc-declare"><code>typedef uint16_t coap_opt_filter_t[COAP_OPT_FILTER_SIZE];
</code></pre>
      <pre class="doc-comment">/**
 * Fixed-size vector we use for option filtering. It is large enough
 * to hold COAP_OPT_FILTER_SHORT entries with an option number between
 * 0 and 255, and COAP_OPT_FILTER_LONG entries with an option number
 * between 256 and 65535. Its internal structure is
 *
 * @code
struct {
  uint16_t mask;
  uint16_t long_opts[COAP_OPT_FILTER_LONG];
  uint8_t short_opts[COAP_OPT_FILTER_SHORT];
}
 * @endcode
 *
 * The first element contains a bit vector that indicates which fields
 * in the remaining array are used. The first COAP_OPT_FILTER_LONG
 * bits correspond to the long option types that are stored in the
 * elements from index 1 to COAP_OPT_FILTER_LONG. The next
 * COAP_OPT_FILTER_SHORT bits correspond to the short option types
 * that are stored in the elements from index COAP_OPT_FILTER_LONG + 1
 * to COAP_OPT_FILTER_LONG + COAP_OPT_FILTER_SHORT. The latter
 * elements are treated as bytes.
 */</pre>

      <h4 id="coap_opt_iterator_t;
">Typedef <span>coap_opt_iterator_t;
</span></h4>
      <pre class="doc-declare"><code>typedef struct {
 size_t length;               /**< remaining length of PDU */
 uint16_t type;               /**< decoded option type */
 unsigned int bad:1;          /**< iterator object is ok if not set */
 unsigned int filtered:1;     /**< denotes whether or not filter is used */
 coap_opt_t *next_option;     /**< pointer to the unparsed next option */
 coap_opt_filter_t filter;    /**< option filter */
} coap_opt_iterator_t;
</code></pre>
      <pre class="doc-comment">/**
 * Iterator to run through PDU options. This object must be
 * initialized with coap_option_iterator_init(). Call
 * coap_option_next() to walk through the list of options until
 * coap_option_next() returns @c NULL.
 *
 * @code
 * coap_opt_t *option;
 * coap_opt_iterator_t opt_iter;
 * coap_option_iterator_init(pdu, &opt_iter, COAP_OPT_ALL);
 *
 * while ((option = coap_option_next(&opt_iter))) {
 *   ... do something with option ...
 * }
 * @endcode
 */</pre>

      <h4 id="coap_optlist_t;
">Typedef <span>coap_optlist_t;
</span></h4>
      <pre class="doc-declare"><code>typedef struct coap_optlist_t {
 struct coap_optlist_t *next; /**< next entry in the optlist chain */
 uint16_t number;             /**< the option number (no delta coding) */
 size_t length;               /**< the option value length */
 uint8_t *data;               /**< the option data */
} coap_optlist_t;
</code></pre>
      <pre class="doc-comment">/**
 * Representation of chained list of CoAP options to install.
 *
 * @code
 * coap_optlist_t *optlist_chain = NULL;
 * coap_pdu_t *pdu = coap_new_pdu(session);
 *
 * ... other set up code ...
 * coap_insert_optlist(&optlist_chain, coap_new_optlist(COAP_OPTION_OBSERVE,
 *                    COAP_OBSERVE_ESTABLISH, NULL));
 *
 * coap_add_optlist_pdu(pdu, &optlist_chain);
 * ... other code ...
 * coap_delete_optlist(optlist_chain);
 * @endcode
 */</pre>
    </div>
  </body>
</html>
            